package sample.test{
	import mx.controls.TextArea;
	
	public class ConsoleManager{
		private var _window:TextArea = null;
		private var _str:Array;
		
		public function ConsoleManager():void{
			_str = new Array();
		}
		
		public function set window(ta:TextArea):void{
			_window = ta;
		}
		
		public function println(msg:String):void{
			_str.push(msg);
			if(_window != null){
				_window.text = _str.join("\n");
			}
		}
		
		public function clear():void{
			if(_window != null){
				_window.text = "";
			}
			_str = new Array();
		}
	}
}